function [res] = Baricenter(Mat,tipo)

if (tipo == 1)
    res = ((Mat(1,1) + Mat(2,1) + Mat(3,1)) / 3);
else
    res = ((Mat(1,2) + Mat(2,2) + Mat(3,2)) / 3);

end